<?php

/****************************************************************************************\
 **   @name		EXP Autos  2.0                                                  **
 **   @package          Joomla 1.6                                                      **
 **   @author		EXP TEAM::Alexey Kurguz (Grusha)                                **
 **   @copyright	Copyright (C) 2005 - 2011  EXP TEAM::Alexey Kurguz (Grusha)     **
 **   @link             http://www.feellove.eu                                          **
 **   @license		Commercial License                                              **
 \****************************************************************************************/

// No direct access.
defined('_JEXEC') or die;

$params_file = JPATH_COMPONENT . '/skins/expuser/default_jquery/parameters/params.php';
if(file_exists($params_file))
require_once $params_file;
ExpAutosProHelper::expskin_lang('expuser','default_jquery');

$cache = JFactory::getCache('com_expautospro', '');
$cache->clean('com_expautospro');
$user = JFactory::getUser();
$document = JFactory::getDocument();
$document->addStyleSheet(JURI::root() . 'components/com_expautospro/assets/css/expautospro.css');
$document->addStyleSheet(JURI::root() . 'components/com_expautospro/skins/expuser/default_jquery/css/validationEngine.jquery.css');
$document->addScript(JURI::root() . 'components/com_expautospro/assets/js/ajaxrequest.js');
$document->addScript(JURI::root() . 'components/com_expautospro/assets/js/ajaxchained.js');
//$filename_form = 'jquery.validationEngine.js';
//$path = JURI::root() . 'components/com_expautospro/skins/expuser/default_jquery/js/';
//JHTML::script($filename_form, $path, true);
if($expuse_jquery)
    $document->addScript(JURI::root() . 'components/com_expautospro/assets/js/jquery.min.js');
$document->addScript(JURI::root() . 'components/com_expautospro/skins/expuser/default_jquery/js/jquery.validationEngine.js');
//$add_script = '';
//$document->addScriptDeclaration($add_script);

if ($user->id && $this->expgroupid){
    if($this->expparams->get('c_admanager_useradd_showgooglemaps')){
        if($this->form->getValue('latitude') && $this->form->getValue('longitude')){
            $lat = $this->form->getValue('latitude');
            $long = $this->form->getValue('longitude');
            $zoom = $this->expparams->get('c_admanager_useradd_googlemaps_zoomstreet');
        }else{
            $lat = $this->expparams->get('c_admanager_useradd_googlemaps_latdef');
            $long = $this->expparams->get('c_admanager_useradd_googlemaps_longdef');
            $zoom = $this->expparams->get('c_admanager_useradd_googlemaps_zoomdef');
        }
        $expzoombycst = $this->expparams->get('c_admanager_useradd_googlemaps_zoomcst');
        $expzoombystreet = $this->expparams->get('c_admanager_useradd_googlemaps_zoomstreet');
        $expgooglewidth = $this->expparams->get('c_admanager_useradd_googlemaps_width');
        $expgoogleheight = $this->expparams->get('c_admanager_useradd_googlemaps_height');

        $document->addScript('http://maps.google.com/maps/api/js?sensor=false');
        $document->addScript(JURI::root() . 'components/com_expautospro/assets/js/expgooglemap.js');
        $script = '';
        $script .= "
            var explat=$lat;
            var explong =$long;
            var expzoom =$zoom;
            var expzoombycst =$expzoombycst;
            var expzoombystreet =$expzoombystreet;
            var expclick = 1;
            var expmapTypeId = google.maps.MapTypeId.".$this->expparams->get('c_general_gmapmaptypeid').";
            var latid = 'jform_latitude';
            var longid = 'jform_longitude';
            var expalert = '".JText::_('COM_EXPAUTOSPRO_GOOGLEMAP_ALERT_TEXT')."';
            var exp_map_canvas = 'exp_map_canvas';
                    ";

        $document->addScriptDeclaration($script);
    }
}
$topmoduleposition = $this->expparams->get('c_admanager_useradd_tmpname');
$bmoduleposition = $this->expparams->get('c_admanager_useradd_bmpname');
$return = JRequest::getVar('return', null, '', 'base64');
//print_r($this->expgroupid);
?>
<script>
    (function($){
    $.fn.validationEngineLanguage = function(){
    };
    $.validationEngineLanguage = {
        newLang: function(){
            $.validationEngineLanguage.allRules = {
                "required": { // Add your regex rules here, you can take telephone as an example
                    "regex": "none",
                    "alertText": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_REQUIRED');?>",
                    "alertTextCheckboxMultiple": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_SELECT_OPTION');?>",
                    "alertTextCheckboxe": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_CHECKBOX_REQ');?>",
                    "alertTextDateRange": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_BOTH_REQ');?>"
                },
                "selectone": { // Add your regex rules here, you can take telephone as an example
                    "regex": "none",
                    "alertText": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_SELECT_OPTION');?>"
                },
                "dateRange": {
                    "regex": "none",
                    "alertText": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_INVALID');?>",
                    "alertText2": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_DATE_RANGE');?>"
                },
                "dateTimeRange": {
                    "regex": "none",
                    "alertText": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_INVALID');?>",
                    "alertText2": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_DATETIME_RANGE');?>"
                },
                "minSize": {
                    "regex": "none",
                    "alertText": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_MINIMUM');?>",
                    "alertText2": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_CHAR_ALLOWED');?>"
                },
                "maxSize": {
                    "regex": "none",
                    "alertText": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_MAXIMUM');?>",
                    "alertText2": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_CHAR_ALLOWED');?>"
                },
				"groupRequired": {
                    "regex": "none",
                    "alertText": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_FOLL_FIELDS');?>"
                },
                "min": {
                    "regex": "none",
                    "alertText": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_MINIMUM_IS');?>"
                },
                "max": {
                    "regex": "none",
                    "alertText": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_MAXIMUM_IS');?>"
                },
                "past": {
                    "regex": "none",
                    "alertText": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_DATE_PRIOR');?>"
                },
                "future": {
                    "regex": "none",
                    "alertText": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_DATE_PAST');?>"
                },	
                "maxCheckbox": {
                    "regex": "none",
                    "alertText": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_MAXIMUM');?>",
                    "alertText2": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_OPTION_ALLOW');?>"
                },
                "minCheckbox": {
                    "regex": "none",
                    "alertText": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_PLEASE_SELECT');?>",
                    "alertText2": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_OPTIONS');?>"
                },
                "equals": {
                    "regex": "none",
                    "alertText": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_FIELDS_NOTMATCH');?>"
                },
                "equalsprice": {
                    "regex": "none",
                    "alertText": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_EQUALPRICE');?>"
                },
                "phone": {
                    // credit: jquery.h5validate.js / orefalo
                    "regex": /^([\+][0-9]{1,3}[ \.\-])?([\(]{1}[0-9]{2,6}[\)])?([0-9 \.\-\/]{3,20})((x|ext|extension)[ ]?[0-9]{1,4})?$/,
                    "alertText": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_INVALID_PHONE');?>"
                },
                "email": {
                    // Shamelessly lifted from Scott Gonzalez via the Bassistance Validation plugin http://projects.scottsplayground.com/email_address_validation/
                    "regex": /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i,
                    "alertText": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_INVALID_EMAIL');?>"
                },
                "integer": {
                    "regex": /^[\-\+]?\d+$/,
                    "alertText": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_NOTVALID_INTEGREL');?>"
                },
                "number": {
                    // Number, including positive, negative, and floating decimal. credit: orefalo
                    "regex": /^[\-\+]?(([0-9]+)([\.,]([0-9]+))?|([\.,]([0-9]+))?)$/,
                    "alertText": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_INVALID_DECIMAL_NUMBER');?>"
                },
                "date": {
                    "regex": /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/,
                    "alertText": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_INVALID_DATE_FORMAT');?>"
                },
                "ipv4": {
                    "regex": /^((([01]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))[.]){3}(([0-1]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))$/,
                    "alertText": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_INVALID_IP');?>"
                },
                "url": {
                    "regex": /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,
                    "alertText": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_INVALID_URL');?>"
                },
                "onlyNumberSp": {
                    "regex": /^[0-9\ ]+$/,
                    "alertText": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_NUMBERS_ONLY');?>"
                },
                "onlyLetterSp": {
                    "regex": /^[a-zA-Z\ \']+$/,
                    "alertText": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_LETTERS_ONLY');?>"
                },
                "onlyLetterNumber": {
                    "regex": /^[0-9a-zA-Z]+$/,
                    "alertText": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_NOSPECIAL_CHAR');?>"
                },
                // --- CUSTOM RULES -- Those are specific to the demos, they can be removed or changed to your likings
                "ajaxUserCall": {
                    "url": "ajaxValidateFieldUser",
                    // you may want to pass extra data on the ajax call
                    "extraData": "name=eric",
                    "alertText": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_USER_ALREADY');?>",
                    "alertTextLoad": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_VALIDATING');?>"
                },
				"ajaxUserCallPhp": {
                    "url": "phpajax/ajaxValidateFieldUser.php",
                    // you may want to pass extra data on the ajax call
                    "extraData": "name=eric",
                    // if you provide an "alertTextOk", it will show as a green prompt when the field validates
                    "alertTextOk": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_USERNAME_AVAILABLE');?>",
                    "alertText": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_USER_ALREADY');?>",
                    "alertTextLoad": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_VALIDATING');?>"
                },
                "ajaxNameCall": {
                    // remote json service location
                    "url": "ajaxValidateFieldName",
                    // error
                    "alertText": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_NAME_ALREADY');?>",
                    // if you provide an "alertTextOk", it will show as a green prompt when the field validates
                    "alertTextOk": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_NAME_AVAILABLE');?>",
                    // speaks by itself
                    "alertTextLoad": "* Validating, please wait"
                },
				 "ajaxNameCallPhp": {
	                    // remote json service location
	                    "url": "phpajax/ajaxValidateFieldName.php",
	                    // error
	                    "alertText": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_NAME_ALREADY');?>",
	                    // speaks by itself
	                    "alertTextLoad": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_VALIDATING');?>"
	                },
                "validate2fields": {
                    "alertText": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_INPUT_HELLO');?>"
                },
	            //tls warning:homegrown not fielded 
                "dateFormat":{
                    "regex": /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(?:(?:0?[1-9]|1[0-2])(\/|-)(?:0?[1-9]|1\d|2[0-8]))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(0?2(\/|-)29)(\/|-)(?:(?:0[48]00|[13579][26]00|[2468][048]00)|(?:\d\d)?(?:0[48]|[2468][048]|[13579][26]))$/,
                    "alertText": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_INVALID_DATE');?>"
                },
                //tls warning:homegrown not fielded 
				"dateTimeFormat": {
	                "regex": /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1}$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^((1[012]|0?[1-9]){1}\/(0?[1-9]|[12][0-9]|3[01]){1}\/\d{2,4}\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1})$/,
                    "alertText": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_INVALID_DATE_OR_FORMAT');?>",
                    "alertText2": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_EXPECTED_FORMAT');?>",
                    "alertText3": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_FORMAT_AM_PM_OR');?>", 
                    "alertText4": "<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SKIN_JQUERY_FORMAT_AM_PM');?>"
	            }
            };
            
        }
    };
    $.validationEngineLanguage.newLang();
})(jQuery);

    jQuery(document).ready(function(){
        jQuery("#expmember-profile").validationEngine();
    });
</script>
<div class="expautospro_topmodule">
    <div class="expautospro_topmodule_pos">
        <?php echo ExpAutosProHelper::load_module_position($topmoduleposition, $this->expparams->get('c_admanager_useradd_tmpstyle')); ?>
    </div>
    <div class="expautospro_clear"></div>
</div>

<!-- Skins Module Position !-->
<?php if($this->expparams->get('c_admanager_useradd_showskin')):?>
<div id="expskins_module">
    <?php
    $expmodparam = array('folder' => $this->expskins);
    echo ExpAutosProHelper::load_module_position('expskins', $style = 'none', $expmodparam);
    ?>
</div>
<div class="expautospro_clear"></div>
<?php endif; ?>

<div id="expautospro">
    <h2><?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_TEXT') ?></h2>
    <?php if ($user->id && $this->expgroupid): ?>
        <div class="expprofile-edit">
            <form id="expmember-profile" action="<?php echo JRoute::_('index.php?option=com_expautospro&view=expuser&task=expuser'); ?>" method="post" enctype="multipart/form-data" name="adminForm" id="expautosprocat-form" class="form-validate">
                <fieldset>
                    <legend><?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_GENERALINFO_TEXT'); ?></legend>
                    <dl>
                        <dt><?php echo $this->form->getLabel('gname'); ?></dt>
                        <dd><?php echo $this->form->getInput('gname'); ?></dd>
                        <dt><?php echo $this->form->getLabel('gusername'); ?></dt>
                        <dd><?php echo $this->form->getInput('gusername'); ?></dd>
                        <dt><?php echo $this->form->getLabel('gemail'); ?></dt>
                        <dd><?php echo $this->form->getInput('gemail'); ?></dd>
                        <dt></dt>
                        <dd>
                            <a href="<?php echo JRoute::_('index.php?option=com_users&task=profile.edit&user_id=' . (int) $user->id); ?>">
                                <?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_GENERALINFO_EDIT_TEXT'); ?>
                            </a>
                        </dd>
                    </dl>
                </fieldset>
                <fieldset>
                    <legend><?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_DEALERINFO_TEXT'); ?></legend>
                    <dl>
                        <dt><?php echo $this->form->getLabel('id'); ?></dt>
                        <dd><?php echo $this->form->getInput('id'); ?></dd>
                        <dt><?php echo $this->form->getLabel('userid'); ?></dt>
                        <dd><?php echo $this->form->getInput('userid'); ?></dd>
                        <?php
                        if ($this->expgroupfields->get('c_lastname')):
                            if ($this->expparams->get('c_user_req_lastname')){
                                $this->form->setFieldAttribute('lastname', 'required', 'true');
                                $this->form->setFieldAttribute('lastname', 'class', "validate[required]");
                            }
                            ?>
                            <dt><?php echo $this->form->getLabel('lastname'); ?></dt>
                            <dd><?php echo $this->form->getInput('lastname'); ?></dd>
                        <?php endif; ?>
                        <?php
                        if ($this->expgroupfields->get('c_ucompany')):
                            if ($this->expparams->get('c_user_req_companyname')){
                                $this->form->setFieldAttribute('companyname', 'required', 'true');
                                $this->form->setFieldAttribute('companyname', 'class', "validate[required]");
                            }
                            ?>
                            <dt><?php echo $this->form->getLabel('companyname'); ?></dt>
                            <dd><?php echo $this->form->getInput('companyname'); ?></dd>
                        <?php endif; ?>
                        <?php
                        if ($this->expgroupfields->get('c_uwebsite')):
                            if ($this->expparams->get('c_user_req_web')){
                                $this->form->setFieldAttribute('web', 'required', 'true');
                                $this->form->setFieldAttribute('web', 'class', "validate[required]");
                            }
                            ?>
                            <dt><?php echo $this->form->getLabel('web'); ?></dt>
                            <dd><?php echo $this->form->getInput('web'); ?></dd>
                        <?php endif; ?>
                        <?php
                        if ($this->expgroupfields->get('c_uphone')):
                            if ($this->expparams->get('c_user_req_phone')){
                                $this->form->setFieldAttribute('phone', 'required', 'true');
                                $this->form->setFieldAttribute('phone', 'class', "validate[required,custom[phone]]");
                            }
                            ?>
                            <dt><?php echo $this->form->getLabel('phone'); ?></dt>
                            <dd><?php echo $this->form->getInput('phone'); ?></dd>
                        <?php endif; ?>
                        <?php
                        if ($this->expgroupfields->get('c_ucphone')):
                            if ($this->expparams->get('c_user_req_cellphone')){
                                $this->form->setFieldAttribute('mobphone', 'required', 'true');
                                $this->form->setFieldAttribute('mobphone', 'class', "validate[required,custom[phone]]");
                            }
                            ?>
                            <dt><?php echo $this->form->getLabel('mobphone'); ?></dt>
                            <dd><?php echo $this->form->getInput('mobphone'); ?></dd>
                        <?php endif; ?>
                        <?php
                        if ($this->expgroupfields->get('c_ufax')):
                            if ($this->expparams->get('c_user_req_fax')){
                                $this->form->setFieldAttribute('fax', 'required', 'true');
                                $this->form->setFieldAttribute('fax', 'class', "validate[required,custom[phone]]");
                            }
                            ?>
                            <dt><?php echo $this->form->getLabel('fax'); ?></dt>
                            <dd><?php echo $this->form->getInput('fax'); ?></dd>
                        <?php endif; ?>
                        <dt><?php echo $this->form->getLabel('emailstyle'); ?></dt>
                        <dd><?php echo $this->form->getInput('emailstyle'); ?></dd>
                        <?php if ($this->expgroupfields->get('c_uinfo')): ?>
                            <dt><?php echo $this->form->getLabel('userinfo'); ?></dt>
                            <dd><?php echo $this->form->getInput('userinfo'); ?></dd>
                        <?php endif; ?>
                        <?php if ($this->expgroupfields->get('c_ulogo')): ?>
                            <div class="expautospro_clear"></div>
                            <br />
                            <dt><?php echo $this->form->getLabel('logo'); ?></dt>
                            <dd><?php echo $this->form->getInput('logo'); ?></dd>
                        <?php endif; ?>
                        <?php if ($this->expgroupfields->get('c_photo')): ?>
                            <div class="expautospro_clear"></div>
                            <br />
                            <dt><?php echo $this->form->getLabel('expphoto'); ?></dt>
                            <dd><?php echo $this->form->getInput('expphoto'); ?></dd>
                        <?php endif; ?>
                        <?php
                        if ($this->expgroupfields->get('c_ucountry')):
                            if ($this->expparams->get('c_user_req_country')){
                                $this->form->setFieldAttribute('country', 'required', 'true');
                                $this->form->setFieldAttribute('country', 'class', "validate[required,selectone]");
                            }
                            ?>
                            <dt><?php echo $this->form->getLabel('country'); ?></dt>
                            <dd><?php echo $this->form->getInput('country'); ?></dd>
                            <?php
                            if ($this->expgroupfields->get('c_ustate')):
                                if ($this->expparams->get('c_user_req_state')){
                                    $this->form->setFieldAttribute('expstate', 'required', 'true');
                                    $this->form->setFieldAttribute('expstate', 'class', "validate[required,selectone]");
                                    }
                                ?>
                                <dt><?php echo $this->form->getLabel('expstate'); ?></dt>
                                <dd><?php echo $this->form->getInput('expstate'); ?></dd>
                                <?php
                                if ($this->expgroupfields->get('c_ucity')):
                                    if ($this->expparams->get('c_user_req_city')){
                                        $this->form->setFieldAttribute('city', 'required', 'true');
                                        $this->form->setFieldAttribute('city', 'class', "validate[required,selectone]");
                                    }
                                    ?>
                                    <dt><?php echo $this->form->getLabel('city'); ?></dt>
                                    <dd><?php echo $this->form->getInput('city'); ?></dd>
                                <?php endif; ?>
                            <?php endif; ?>
                        <?php endif; ?>
                        <?php
                        if ($this->expgroupfields->get('c_ustreet')):
                            if ($this->expparams->get('c_user_req_street')){
                                $this->form->setFieldAttribute('street', 'required', 'true');
                                $this->form->setFieldAttribute('street', 'class', "validate[required]");
                            }
                            if($this->expparams->get('c_admanager_useradd_showgooglemaps'))
                                $this->form->setFieldAttribute('street', 'onchange', 'codeStreet(this.value);return false;');
                            ?>
                            <dt><?php echo $this->form->getLabel('street'); ?></dt>
                            <dd><?php echo $this->form->getInput('street'); ?></dd>
                        <?php endif; ?>
                        <?php
                        if ($this->expgroupfields->get('c_uzip')):
                            if ($this->expparams->get('c_user_req_zipcode')){
                                $this->form->setFieldAttribute('zipcode', 'required', 'true');
                                $this->form->setFieldAttribute('zipcode', 'class', "validate[required]");
                            }
                            ?>
                            <dt><?php echo $this->form->getLabel('zipcode'); ?></dt>
                            <dd><?php echo $this->form->getInput('zipcode'); ?></dd>
                        <?php endif; ?>
                        <?php if($this->expparams->get('c_admanager_useradd_showgooglemaps')):
                            if ($this->expparams->get('c_admanager_useradd_latlong')){
                                $this->form->setFieldAttribute('latitude', 'required', 'true');
                                $this->form->setFieldAttribute('longitude', 'required', 'true');
                                $this->form->setFieldAttribute('latitude', 'class', "validate[required]");
                                $this->form->setFieldAttribute('longitude', 'class', "validate[required]");
                            }
                            $this->form->setFieldAttribute('latitude', 'onchange', 'findLangLong();return false;');
                            $this->form->setFieldAttribute('longitude', 'onchange', 'findLangLong();return false;');
                            ?>
                                <dt><?php echo $this->form->getLabel('latitude'); ?></dt>
                                <dd><?php echo $this->form->getInput('latitude'); ?></dd>


                                <dt><?php echo $this->form->getLabel('longitude'); ?></dt>
                                <dd><?php echo $this->form->getInput('longitude'); ?></dd>
                        <?php endif; ?>
                    </dl>
                    <div class="expautospro_clear"></div>
                    <?php if($this->expparams->get('c_admanager_useradd_showgooglemaps')):?> 
                        <div id="exp_map_canvas" style="width: <?php echo $expgooglewidth;?>px; height: <?php echo $expgoogleheight;?>px;"></div>
                    <?php endif; ?>
                </fieldset>
                <div>
                    <input class="submit button" type="submit" value="<?php echo JText::_('COM_EXPAUTOSPRO_CP_EXPUSER_SAVE_TEXT'); ?>"/>

                    <input type="hidden" name="option" value="com_expautospro" />
                    <input type="hidden" name="task" value="expuser.save" />
                    <input type="hidden" name="return" value="<?php echo $return;?>" />
                    <?php echo JHtml::_('form.token'); ?>
                </div>
            </form>
        </div>
    <?php else: ?>
        <?php if (!$user->id): ?>
            <?php echo JText::_(JText::sprintf('COM_EXPAUTOSPRO_CP_DEALER_PAYMENT_ONLYREGISTERED_TEXT', JRoute::_('index.php?option=com_users&view=login'), JRoute::_('index.php?option=com_users&view=registration'))); ?>
        <?php elseif (!$this->expgroupid): ?>
            <?php echo JText::_(JText::sprintf('COM_EXPAUTOSPRO_CP_EXPUSER_DEALERINFO_PERMISSION_DENIED_TEXT', JRoute::_('index.php?option=com_expautospro&view=exppaylevel'))); ?>
        <?php endif; ?>

    <?php endif; ?>
</div>
<div class="expautospro_clear"></div>
<?php if ($bmoduleposition): ?>
    <div class="expautospro_botmodule">
        <?php echo ExpAutosProHelper::load_module_position($bmoduleposition, $this->expparams->get('c_admanager_useradd_bmpstyle')); ?>
    </div>
<?php endif; ?>
